<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var choice = prompt('请输入数字1-4')
        choice = parseInt(choice);
        switch(choice) {
            case 1:
                alert("数字1");
                break;
            case 2: 
                alert('数字2');
                break;
            case 3: 
                alert('数字3')
                break;
            case 4: 
                alert('数字4')
                break;
            default: 
                alert('请输入数值1-4')
        }
    </script>
</head>

<body>

</body>

</html>